<template>
  <VCommonHeaderLeft>
    <div class="details">
      <Navigation :msg="navMsg"></Navigation>
      <div class="content">
        <div class="content-top">
          <div class="top-title">
            <!-- @click="return false" -->
            <a href='javascript:void(0)'>入库单详情</a>
            <span class="cont-active-line"></span>
          </div>
          <div class="icons">
            <div class="icon-inb">
              <a href="javascript:void(0)">
                <span class="iconfont icon-test213">&nbsp;打印</span>
              </a>
            </div>
            <div class="icon-inb icon-right">
              <a href="javascript:void(0)">
                <span class="iconfont icon-test151">&nbsp;导出</span>
                <span class="iconfont icon-test189"></span>
              </a>
              <div class="icon-select">
                <span>导出Excel</span>
                <span>导出PDF</span>
              </div>
            </div>
          </div>
        </div>
        <div class="content-main"
             :style="{ height: tableHeight }">
          <div class="mian-info">
            <h3>基本信息</h3>
            <ul class="main-list">
              <li v-for="item in 6"
                  :key="item">
                <div class="list-items">
                  <div class="item-title">
                    <i class="round"></i>客户名称
                  </div>
                  <div class="item-main">
                    <span title='深圳宝能太古'>深圳宝能太古</span>
                  </div>
                </div>
              </li>
            </ul>
          </div>
          <div class="main-table">
            <h3>入库清单</h3>
            <table class="table-box">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>订单号</th>
                  <th>规格图</th>
                  <th>商品名称/商品编号</th>
                  <th>规格名称/规格编号</th>
                  <th>系统库存</th>
                  <th>数量</th>
                  <th>单位</th>
                  <th>备注</th>
                </tr>
              </thead>
              <tbody>
                <tr v-for="(item, index) in 8"
                    :key="index">
                  <td>{{ index+1 }}</td>
                  <td>DH-20181229-000001</td>
                  <td><img src="../../../../../static/images/100.jpg"></td>
                  <td>
                    <div class="td-p">
                      <p class='ellipsis'
                         title="秋款 高腰韩版秋装小脚裤">秋款 高腰韩版秋装小脚裤</p>
                      <p class="td-gray"
                         title="A338">A338</p>
                    </div>
                  </td>
                  <td>
                    <div class="td-p">
                      <p class='ellipsis'
                         title="颜色:白色加绒；尺码:S；">颜色:白色加绒；尺码:S；</p>
                      <p class="td-gray"
                         title="2018031400003385">2018031400003385</p>
                    </div>
                  </td>
                  <td>
                    <p title="-3.0">-3.0</p>
                  </td>
                  <td>
                    <p title="1.0">1.0</p>
                  </td>
                  <td>
                    <p title="条">条</p>
                  </td>
                  <td></td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="main-others">
            <div class="invoices-info">
              <h3>单据信息</h3>
              <ul class="invoices-list">
                <li v-for="item in 4"
                    :key="item">
                  <div class="list-items">
                    <div class="item-title">
                      <i class="round"></i>制单人
                    </div>
                    <div class="item-main">
                      <span title='陈素然'>陈素然</span>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="details-footer">
          <div class="footer-btn">
            <span class="iconfont icon-test185"></span>
            <span>作废出库单</span>
          </div>
        </div>
      </div>
    </div>
  </VCommonHeaderLeft>
</template>
<script>
import VCommonHeaderLeft from '@/components/common/vCommonHeaderLeft/VCommonHeaderLeft'
import Navigation from '@/components/common/navigation/Navigation'
export default {
  data () {
    return {
      tableHeight: '',
      navMsg: [
        {
          name: '仓库',
          path: '/outStock'
        },
        {
          name: '商品入库',
          path: '/inStock'
        },
        {
          name: '查看入库单',
          path: ''
        }
      ],
      stock: []
    }
  },
  components: {
    Navigation,
    VCommonHeaderLeft
  },
  created () {
    this.getHight()
    window.addEventListener('resize', this.getHight)
  },
  mounted () {
    // 显示隐藏
    let overEle = document.getElementsByClassName('icon-right')[0]
    overEle.addEventListener('mouseover', this.showSelect, false)
    overEle.addEventListener('mouseleave', this.hideSelect, false)
  },
  destroyed () {
    window.removeEventListener('resize', this.getHight)
  },
  methods: {
    showSelect () {
      let select = document.getElementsByClassName('icon-select')[0]
      select.style.display = 'block'
    },
    hideSelect () {
      let select = document.getElementsByClassName('icon-select')[0]
      select.style.display = 'none'
    },
    getHight () {
      this.tableHeight = window.innerHeight - 280 + 'px'
    }
  }
}
</script>
<style lang="scss" scoped>
.details {
  width: 100%;
  overflow: hidden;
  .content {
    height: 100%;
    margin-right: 10px;
    background-color: #fff;
    .detail-box {
      font-size: 12px;
      padding: 24px 24px 6px;
      margin-top: 16px;
    }
    .content-top {
      color: #20ade5;
      min-height: 51px;
      padding: 0 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #e3e3e3;
      a {
        display: inline-block;
        font-size: 16px;
        color: #20ade5;
        height: 50px;
        line-height: 50px;
        cursor: pointer;
      }
      .top-title {
        flex: 1;
        // border: 1px solid #000;
        position: relative;
        a {
          padding: 0 8px;
          min-width: 106px;
          letter-spacing: 2px;
          font-weight: 600;
        }
        .cont-active-line {
          display: block;
          min-width: 106px;
          height: 2px;
          position: absolute;
          bottom: 0;
          left: 0;
          background: #20ade5;
        }
      }
      .icons {
        width: 160px;
        height: 50px;
        line-height: 50px;
        font-size: 16px;
        // border: 1px solid #000;
        .icon-inb {
          display: inline-block;
          a {
            margin-right: 20px;
          }
        }
        .icon-right {
          position: relative;
          .icon-select {
            display: none;
            position: absolute;
            top: 50px;
            left: -50px;
            width: 140px;
            color: #666;
            background-color: #fff;
            border: 1px solid #f5f5f5;
            box-shadow: 0 5px 14px 0 rgba(0, 0, 0, 0.1);
            line-height: 1em;
            z-index: 3;
            span {
              display: block;
              width: 100%;
              height: 40px;
              line-height: 40px;
              font-size: 12px;
              text-align: left;
              color: #333;
              padding-left: 16px;
              border-bottom: 1px solid #f5f5f5;
              cursor: pointer;
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
              &:hover {
                background-color: #f1f8ff;
                color: #20ade5;
              }
            }
          }
        }
      }
    }
    .content-main {
      font-size: 12px;
      padding: 28px 24px 24px;
      background: #ffffff;
      overflow: scroll;
      overflow-x: hidden;
      overflow-y: hidden;
      &:hover {
        overflow-y: overlay;
      }
      &::-webkit-scrollbar {
        width: 8px;
      }
      &::-webkit-scrollbar-thumb {
        border-radius: 10px;
        background-color: rgba(0, 0, 0, 0.2);
      }
      &::-webkit-scrollbar-track {
        border-radius: 0;
        background-color: rgba(0, 0, 0, 0.1);
      }
      &:first-child {
        padding-top: 12px;
        padding-bottom: 24px;
      }
      .mian-info {
        .main-list {
          border-top: 1px solid #e3e3e3;
          padding-top: 14px;
          text-align: left;
          padding-bottom: 8px;
          li {
            display: inline-block;
            width: calc(50% - 32px);
            font-size: 0;
            vertical-align: top;
          }
          li:nth-child(2n + 1) {
            margin-right: 60px;
          }
          .list-items {
            display: flex;
            overflow: hidden;
            border-bottom: 1px solid #f5f5f5;
            .round {
              display: inline-block;
              width: 6px;
              height: 6px;
              background: #d2d2d2;
              border-radius: 50%;
              margin: 0 10px 2px 0;
            }
            .item-title {
              width: 130px;
              padding: 13px 24px 13px 0;
              text-align: left;
              font-size: 12px;
              color: #666;
            }
            .item-main {
              width: 100%;
              padding: 14px 0;
              font-size: 12px;
              color: #333;
              min-height: 20px;
            }
          }
        }
      }
      .main-table {
        font-size: 11px;
        padding: 24px 0 6px;
        background: #ffffff;
        margin-top: 16px;
        width: 100%;
        min-width: 800px;
        .table-box {
          border: 1px solid #e3e3e3;
          width: 100%;
          border-collapse: collapse;
          border-spacing: 0;
          tr {
            display: table-row;
            th {
              position: relative;
              border-top: 1px solid #e3e3e3;
              border-bottom: 1px solid #e3e3e3;
              background: #fcfcfc;
              line-height: 48px;
              font-size: 12px;
              font-weight: 400;
              color: #666;
              text-align: center;
              padding: 0 10px;
              white-space: nowrap;
              vertical-align: middle;
            }
            td {
              text-align: center;
              font-size: 12px;
              line-height: 1.5;
              height: 78px;
              color: #333;
              border: 1px solid #e3e3e3;
              vertical-align: middle;
              padding: 0 10px;
              img {
                display: inline-block;
                width: 62px;
                height: 62px;
              }
            }
            &:first-child {
              width: 60px;
            }
            .td-p {
              text-align: left;
              padding-left: 12px;
              .td-gray {
                color: #999;
              }
            }
          }
          .ellipsis {
            display: -webkit-box;
            overflow: hidden;
            white-space: normal !important;
            text-overflow: ellipsis;
            word-wrap: break-word;
            word-break: break-all;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
          }
        }
      }
      .main-others {
        // padding: 24px 24px 6px;
        margin: 16px 0;
        .invoices-info {
          padding: 24px 24px 6px 0;
          margin: 16px 0;
          .invoices-list {
            border-top: 1px solid #e3e3e3;
            padding-top: 14px;
            text-align: left;
            padding-bottom: 8px;
            li {
              display: inline-block;
              width: calc(50% - 32px);
              font-size: 0;
              vertical-align: top;
            }
            li:nth-child(2n + 1) {
              margin-right: 60px;
            }
            .list-items {
              display: flex;
              overflow: hidden;
              border-bottom: 1px solid #f5f5f5;
              .round {
                display: inline-block;
                width: 6px;
                height: 6px;
                background: #d2d2d2;
                border-radius: 50%;
                margin: 0 10px 2px 0;
              }
              .item-title {
                width: 130px;
                padding: 13px 24px 13px 0;
                text-align: left;
                font-size: 12px;
                color: #666;
              }
              .item-main {
                width: 100%;
                padding: 14px 0;
                font-size: 12px;
                color: #333;
                min-height: 20px;
              }
            }
          }
        }
      }
      h3 {
        position: relative;
        display: inline-block;
        color: #333;
        padding: 0 10px 10px 6px;
        font-weight: 600;
        font-size: 16px;
        vertical-align: middle;
        &:before {
          content: "";
          width: 2px;
          height: 16px;
          background: #333;
          position: absolute;
          top: 10%;
          left: 0;
        }
      }
    }
    .details-footer {
      background: #ffffff;
      box-shadow: inset 0 1px 0 0 #e3e3e3;
      padding: 10px 24px;
      min-height: 42px;
      font-size: 16px;
      font-weight: 400;
      text-align: right;
      .footer-btn {
        $initialColor: #d2d2d2;
        $secondColor: #b3b3b3;
        display: inline-block;
        text-align: center;
        width: 150px;
        height: 42px;
        line-height: 42px;
        color: $initialColor;
        border: 1px solid $initialColor;
        cursor: pointer;
        .icon-test185 {
          width: 16px;
          height: 16px;
          padding-right: 6px;
          color: inherit;
        }
        &:hover {
          color: $secondColor;
          border: 1px solid $secondColor;
        }
      }
    }
  }
}
</style>
